import React from 'react';
import { Button, Col, Form, Input, Row, Table } from 'antd';
import DesignerSetterModal from '../../../designer/SetterModal';
export * from './index'
export const Setter= ({  }) => {
  
  return (<div>
    <Form.Item label="列">
    <DesignerSetterModal  trigger={
      <Button>设置</Button>
    }    
    >
  
    <Form.List name="columns">
      {(dataSource,{add})=>{
        return <div>
          <Table 
          columns={[{
            dataIndex:'key',
            title:'标题',
            render(value, record, index) {
                return <Form.Item name={[record.name,'title']}><Input/></Form.Item>
            },
          },{
            dataIndex:'key',
            title:'类型',
            render(value, record, index) {
                return <Form.Item name={[record.name,'valueType']}><Input/></Form.Item>
            },
          },{
            dataIndex:'key',
            title:'字段',
            render(value, record, index) {
                return <Form.Item name={[record.name,'dataIndex']}><Input/></Form.Item>
            },
          }]}
          pagination={false} dataSource={dataSource}/>
          <Button block shape='round'  type='dashed' onClick={()=>add({title:'标题'})}>增加列</Button>
        </div>
      }}
    </Form.List>
        
    </DesignerSetterModal>
    </Form.Item>

    <Form.Item name="span" label="文字">
        <Input/>
    </Form.Item>
  </div>)
}
